const net = require('net');

const PORT = 3000;
const LOCAL = '127.0.0.1';
const tcp = net.createServer((socker)=>{
    socker.on('data',(data)=>{
        console.log(data.toString(),'==client data');
        socker.write('black client data: hello world')
    })

    socker.on('close',function(){
        console.log('tpl close');
    })
})

tcp.listen(PORT,LOCAL,()=>{
    console.log('listen at http://localhost:3000')
})